package com.cecsmsserve.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cecsmsserve.entity.HealthRecord;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface HealthRecordService extends IService<HealthRecord> {
    /**
     * 添加健康记录
     */
    boolean addRecord(HealthRecord healthRecord);
    
    /**
     * 更新健康记录
     */
    boolean updateRecord(HealthRecord healthRecord);
    
    /**
     * 删除健康记录
     */
    boolean deleteRecord(Integer id, Integer userId);
    
    /**
     * 根据用户ID分页获取健康记录
     */
    Page<HealthRecord> getRecordsByUserIdWithPage(Integer pageNum, Integer pageSize, Integer userId);
    
    /**
     * 根据ID获取健康记录详情
     */
    HealthRecord getRecordDetailById(Integer id);
    
    /**
     * 根据类型和日期范围获取健康记录(用于图表展示)
     */
    List<HealthRecord> getRecordsByTypeAndDateRange(Integer userId, Integer typeId, LocalDate startDate, LocalDate endDate);
    
    /**
     * 获取用户健康记录统计信息
     */
    List<Map<String, Object>> getTypeStatistics(Integer userId, LocalDate startDate, LocalDate endDate);
    
    /**
     * 检查用户某天是否已记录某类型的健康数据
     */
    Integer checkExistingRecord(Integer userId, Integer typeId, LocalDate recordDate);
} 